package com.xm.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xm.dao.RoleDao;
import com.xm.pojo.Role;
import com.xm.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    RoleDao RoleDao;

    @Override
    public int saveRole(Role Role) {
        return RoleDao.insert(Role);
    }

    @Override
    public int deleteById(Integer...ids) {
        return RoleDao.deleteById(ids);
    }

    @Override
    public int updateRole(Role Role) {
        return RoleDao.updateById(Role);
    }

    @Override
    public List<Role> findRole(Role Role) {

        return RoleDao.selectList(new QueryWrapper(Role));
    }

    @Override
    public Role findById(Integer id) {
        return RoleDao.selectById(id);
    }
}

